package br.com.bco.negocio;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.joda.time.DateTime;

@Entity
@Table(name = "CHEGADAS_BCO")
public class Chegada extends ObjetoPersistente {

    private static final long serialVersionUID = -2258140636561458430L;
    private DateTime horaChegada;
    private Terminal terminal;

    @Transient
    public DateTime getHoraChegada() {
        return horaChegada;
    }

    public void setHoraChegada(DateTime horaChegada) {
        this.horaChegada = horaChegada;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "TERMINAL_ID")
    public Terminal getTerminal() {
        return terminal;
    }

    public void setTerminal(Terminal terminal) {
        this.terminal = terminal;
    }

}
